{include file="public/header" /}

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">
                    共有数据：<strong id="count">{$list->total()}</strong> 条
                </div>
                <div class="layui-card-body layui-table-body layui-table-main">
                    <table class="layui-table layui-form">
                        <thead>
                            <tr>
                                <th>ID编号</th>
                                <th>设置名</th>
                                <th>设置值</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            {foreach $list as $v}
                            <tr>
                                <td>{$v.id|default='0'}</td>
                                <td>{$v.name|default='0'}</td>
                                {if $v.key_value == 'plathandfee'}
                                <td>可提币阶段：
                                    {if(!empty($v.value.coinnum) && count($v.value.coinnum) > 0)}
                                    {foreach $v.value.coinnum as $k => $coinnum}
                                    {$coinnum}个
                                    {if $k < count($v.value.coinnum) - 1}~{/if} {/foreach} {else} 无 {/if}<br />
                                    提币手续费阶段：
                                    {if(!empty($v.value.coinhandfee) && count($v.value.coinhandfee) > 0)}
                                    {foreach $v.value.coinhandfee as $k => $coinhandfee}
                                    {$coinhandfee}个
                                    {if $k < count($v.value.coinhandfee) - 1}~{/if} {/foreach} {else} 无 {/if} </td>
                                    {elseif $v.key_value == 'platformswitch' /}
                                    <td>
                                   {switch name="$v.value"}
                                        {case value="1"} <span class="label label-default radius">开</span> {/case}
                                        {case value="2"} <span class="label label-primary radius">关</span> {/case}</td>
                                   {/switch}
                                        {elseif $v.key_value == 'lockrateInterval'}
                                        <td>锁仓阶段：
                                            {if(!empty($v.value.money) && count($v.value.money) > 0)}
                                            {foreach $v.value.money as $k => $money}
                                            {$money}USDT
                                            {if $k
                                            < count($v.value.money) - 1}~{/if} {/foreach} {else} 无 {/if}<br />
                                            释放阶段比率
                                            {if(!empty($v.value.rate) && count($v.value.rate) > 0)}
                                            {foreach $v.value.rate as $k => $rate}
                                            {$rate}%
                                            {if $k < count($v.value.rate) - 1}~{/if} {/foreach} {else} 无 {/if} </td>
                                        {elseif $v.key_value == 'otherhandfee' || $v.key_value == 'jsrhandfee' ||
                                        $v.key_value == 'ethotherhandfee' || $v.key_value == 'btcotherhandfee'}
                                <td>
                                    最低起提：{$v.value.coinnum|default="0"}<br />
                                    提币百分比：{$v.value.coinhandfee|default="0"}%
                                </td>
                                {else}
                                <td>{$v.value|default='0'}</td>
                                {/if}
                                <td class="td-manage">
                                    <a title="编辑" onclick="data_edit('编辑','/system/config_edit?id={$v.id}')"
                                        href="javascript:;" class="layui-btn">
                                        编辑
                                    </a>
                                </td>

                            </tr>
                            {/foreach}

                        </tbody>
                    </table>
                </div>
                <div class="layui-card-body ">
                    <div class="page">
                        {$list->render()|raw}
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>
</body>
<script>
    layui.use('upload', function () {
        var $ = layui.jquery
            , upload = layui.upload;
        //图片上传
        var uploadInst = upload.render({
            elem: '#test1'
            , url: 'users_top'
            , accept: 'file'
            , exts: 'xls|csv'
            , before: function (obj) {
                //预读本地文件示例，不支持ie8
                obj.preview(function (index, file, result) {
                    $('#demo1').attr('src', result); //图片链接（base64）
                });
            }
            , done: function (res) {
                //如果上传失败
                if (res.status > 0) {
                    return layer.msg(res.msg);
                }
                //上传成功
                return layer.msg(res.msg);
            }
            , error: function () {
                //演示失败状态，并实现重传
                var demoText = $('#demoText');
                demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
                demoText.find('.demo-reload').on('click', function () {
                    uploadInst.upload();
                });
            }
        });
    });
    function showimg(imgs) {
        console.log(imgs);
        layer.open({
            type: 1,
            title: false,
            shadeClose: true,
            skin: 'layui-layer-nobg', //没有背景色
            content: "<img src='" + imgs + "' style='width:100%;height: 100%;'>"
        });
    }
    function orderstr(title, url, id, status) {
        layer.confirm(title, { title: '请谨慎操作' }, function (index) {
            $.post(url, { id: id, status: status }, function (data) {
                if (data.status == 0) {
                    layer.msg(data.msg, { icon: 1, time: 1000 });
                    location.replace(location.href);
                } else {
                    layer.msg(data.msg, { icon: 2, time: 1000 });
                }
            });
        });
    }
</script>
{include file="public/footer"}